package edu.sctu.yueding.activitys;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import edu.sctu.yueding.R;
import edu.sctu.yueding.utils.JumpUtils;

/**
 * Created by Administrator on 2016/10/9.
 */
public class ConversationListActivity extends BaseActivity {

    private TextView tvBack;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.conversationlist);
        initSystemBar(this, 0);

        tvBack = (TextView) findViewById(R.id.id_back);

        tvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Bundle bundle = new Bundle();
                bundle.putInt("flag", 3);
                JumpUtils.activityToFragmentJump(ConversationListActivity.this, bundle);
            }
        });

    }

    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK
                && event.getRepeatCount() == 0) {

            Bundle bundle = new Bundle();
            bundle.putInt("flag", 3);
            JumpUtils.activityToFragmentJump(ConversationListActivity.this, bundle);

            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}